/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package co.com.entidad;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
 *
 * @author 841756
 */
@Entity
@Table(name = "tblcesantias")
@NamedQueries({
    @NamedQuery(name = "Tblcesantias.findAll", query = "SELECT t FROM Tblcesantias t"),
    @NamedQuery(name = "Tblcesantias.findByCodCesantias", query = "SELECT t FROM Tblcesantias t WHERE t.codCesantias = :codCesantias"),
    @NamedQuery(name = "Tblcesantias.findByNomCesantias", query = "SELECT t FROM Tblcesantias t WHERE t.nomCesantias = :nomCesantias"),
    @NamedQuery(name = "Tblcesantias.findByNitCesantias", query = "SELECT t FROM Tblcesantias t WHERE t.nitCesantias = :nitCesantias")})
public class Tblcesantias implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "cod_cesantias")
    private Short codCesantias;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nom_cesantias")
    private String nomCesantias;
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 50)
    @Column(name = "nit_cesantias")
    private String nitCesantias;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "fondoC")
    private List<Tbldatosgenerales> tbldatosgeneralesList;
    @JoinColumn(name = "cod_compania", referencedColumnName = "cod_compania")
    @ManyToOne(optional = false)
    private Tblcompania codCompania;
    @JoinColumn(name = "id_estado", referencedColumnName = "id_estado")
    @ManyToOne(optional = false)
    private TblEstado idEstado;

    public Tblcesantias() {
    }

    public Tblcesantias(Short codCesantias) {
        this.codCesantias = codCesantias;
    }

    public Tblcesantias(Short codCesantias, String nomCesantias, String nitCesantias) {
        this.codCesantias = codCesantias;
        this.nomCesantias = nomCesantias;
        this.nitCesantias = nitCesantias;
    }

    public Short getCodCesantias() {
        return codCesantias;
    }

    public void setCodCesantias(Short codCesantias) {
        this.codCesantias = codCesantias;
    }

    public String getNomCesantias() {
        return nomCesantias;
    }

    public void setNomCesantias(String nomCesantias) {
        this.nomCesantias = nomCesantias;
    }

    public String getNitCesantias() {
        return nitCesantias;
    }

    public void setNitCesantias(String nitCesantias) {
        this.nitCesantias = nitCesantias;
    }

    public List<Tbldatosgenerales> getTbldatosgeneralesList() {
        return tbldatosgeneralesList;
    }

    public void setTbldatosgeneralesList(List<Tbldatosgenerales> tbldatosgeneralesList) {
        this.tbldatosgeneralesList = tbldatosgeneralesList;
    }

    public Tblcompania getCodCompania() {
        return codCompania;
    }

    public void setCodCompania(Tblcompania codCompania) {
        this.codCompania = codCompania;
    }

    public TblEstado getIdEstado() {
        return idEstado;
    }

    public void setIdEstado(TblEstado idEstado) {
        this.idEstado = idEstado;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (codCesantias != null ? codCesantias.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tblcesantias)) {
            return false;
        }
        Tblcesantias other = (Tblcesantias) object;
        if ((this.codCesantias == null && other.codCesantias != null) || (this.codCesantias != null && !this.codCesantias.equals(other.codCesantias))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "" + nomCesantias + "";
    }
    
}
